/*******************************************************************************
 * Copyright (c) 2008 Actuate Corporation.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * https://www.eclipse.org/legal/epl-2.0/.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/

package org.eclipse.birt.chart.reportitem;

import org.eclipse.birt.chart.factory.IDataRowExpressionEvaluator;
import org.eclipse.birt.chart.factory.IGroupedDataRowExpressionEvaluator;
import org.eclipse.birt.chart.model.Chart;
import org.eclipse.birt.chart.model.Serializer;
import org.eclipse.birt.chart.model.impl.SerializerImpl;
import org.eclipse.birt.chart.render.IActionRenderer;
import org.eclipse.birt.chart.reportitem.api.IChartReportItem;
import org.eclipse.birt.report.data.adapter.api.IModelAdapter;
import org.eclipse.birt.report.engine.api.IHTMLActionHandler;
import org.eclipse.birt.report.engine.api.script.IReportContext;
import org.eclipse.birt.report.engine.extension.ICubeResultSet;
import org.eclipse.birt.report.engine.extension.IReportItemPresentation;
import org.eclipse.birt.report.engine.extension.IReportItemPresentationInfo;
import org.eclipse.birt.report.model.api.DesignElementHandle;
import org.eclipse.birt.report.model.api.ExtendedItemHandle;

/**
 * Basic implementation of report item factory.
 */

public class ChartReportItemFactoryBase implements IChartReportItemFactory {

	@Override
	public IActionRenderer createActionRenderer(DesignElementHandle eih, IHTMLActionHandler handler,
			IDataRowExpressionEvaluator evaluator, IReportContext context) {
		return new BIRTActionRenderer(eih, handler, evaluator, context);
	}

	@Override
	public IReportItemPresentation createReportItemPresentation(IReportItemPresentationInfo info) {
		return new ChartReportItemPresentationImpl();
	}

	@Override
	public Serializer createSerializer(ExtendedItemHandle eih) {
		return SerializerImpl.instance();
	}

	@Override
	public ChartCubeQueryHelper createCubeQueryHelper(ExtendedItemHandle handle, Chart cm, IModelAdapter modelAdapter) {
		return new ChartCubeQueryHelper(handle, cm, modelAdapter);
	}

	@Override
	public IGroupedDataRowExpressionEvaluator createCubeEvaluator(Chart cm, ICubeResultSet set) {
		return new BIRTCubeResultSetEvaluator(set);
	}

	@Override
	public IChartReportItem createChartReportItem(ExtendedItemHandle eih) {
		return new ChartReportItemImpl(eih);
	}

	@Override
	public ChartBaseQueryHelper createQueryHelper(ExtendedItemHandle handle, Chart cm, IModelAdapter modelAdapter) {
		return new ChartBaseQueryHelper(handle, cm, modelAdapter);
	}
}
